package com.example.controller.pc;

import com.example.mapper.pc.ScheduleMapper;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "远程调用")
@RequestMapping("/api/resource")
public class RemoteCallController {

    @Autowired
    private ScheduleMapper scheduleMapper;

//    @ApiOperation("机器列表")
//    @GetMapping("getMachine/{workCenter}")
//    public Result<List<Machine>> getMachine(@PathVariable String workCenter) {
//        if(StringUtils.isEmpty(workCenter)) {
//            return Result.error("工作中心为空");
//        }
//        return Result.success(scheduleMapper.getMachine(workCenter));
////        HashMap<String, Object> paramMap = new HashMap<>();
////        paramMap.put("MX002", workCenter);
////        String result3 = HttpUtil.get(UrlConstant.getMachine, paramMap);
////        Result<List> result = JSONUtil.toBean(result3, Result.class);
////        List data = result.getData();
//////        System.out.println(data);
////        List<Machine> res = new ArrayList<>();
////        for (int i = 0; i < data.size(); i++) {
////            JSONObject jsonObject = (JSONObject) data.get(i);
//////            System.out.println(jsonObject);
////            Machine bean = jsonObject.toBean(Machine.class);
////            Machine machine = new Machine();
////            BeanUtils.copyPropertiesIgnoreCase(bean, machine);
////            res.add(machine);
////        }
//    }

}
